#include <iostream>
using namespace std;
int main() {
  string str;
  cin >> str;

  auto encode = [](auto &self, string s) -> string {
    if (s.find('0') == string::npos) return "B";
    if (s.find('1') == string::npos) return "A";
    int half = s.length() / 2;
    return "C" + self(self, s.substr(0, half)) + self(self, s.substr(half));
  };

  cout << encode(encode, str) << endl;
}